image_scroller = function (id,interval,width,height,margin) {
    var $_is = this;
    
    $_is.id = (id ? id : "scroller");
    $_is.interval = (interval ? interval : 6000);
    $_is.width = (width ? width : 500);
    $_is.height = (height ? height : 50);
    $_is.left = 0;
    $_is.last_width = 0;
    $_is.margin = (margin ? margin : 120);
    $_is.placement = [ "", 150  , 0, 75 , 100];
    $_is.t = "";
    $_is.rotate = true;
    
    $_is.scroll = function () {   
        if ($_is.rotate) {
            $_is.rotate = false;
      
            
        $("div#" + $_is.id + " > ul > li:nth-child(1)").appendTo("div#" + $_is.id + " > ul");
        for (var n=1; n<= $("div#" + $_is.id + " > ul > li").length; n++) {
            $("div#" + $_is.id + " > ul > li:nth-child(" + n + ")").stop().animate( {
               left : $_is.placement[n]
            },1000);
        }
         $_is.rotate = true;
        }
    }; 
    
    $_is.theScroller = function () {
        $_is.t = setInterval(function () {$_is.scroll()}, $_is.interval);
    };
    
    $_is.setPlaces = function () {
        var l = 10;
        for (var n=2; n<= $("div#" + $_is.id + " > ul > li").length; n++) {
            $_is.placement[n] = l;
            l+=$_is.margin;
        }
        $_is.placement[1]=l;
    };
    
    $_is.stop = function () {
        clearTimeout($_is.t)
    };
    
    $_is.initialize = function () {
      //  $(document).ready(function() {	
            $("div#" + $_is.id).css ({
                width: $_is.width,
                height: $_is.height  + 12,
                overflow:"hidden",
                position:"absolute"
            });
            
            $("div#" + $_is.id + "  ul").css ({
                padding: 0,
                margin: 0
            });
            
            
            $("div#" + $_is.id + " > ul").css ({
         
                position:"absolute"
            });
            
            $("div#" + $_is.id + " > ul > li").css ({
                "list-style": "none",
                "float": "left",
                "position": "absolute",
                width: $_is.height
            });
            
            $("div#" + $_is.id + " > ul > li > img, div#" + $_is.id + " > ul > li > a  > img").css ({
                top:"0px"
            });
            
            $("div#" + $_is.id + " > ul > li > div").css ({
                background: "#FFF",
                position:"absolute",
                top:"0px"
            });           
           
           $_is.setPlaces();
           $_is.scroll();        
            
            $_is.theScroller();
            $("div#" + $_is.id).show();
      //  });
    };
    
    
    $_is.load = function () {
    var productElement = document.getElementById($_is.id);
    if (productElement != null)  $_is.initialize(); 
    else var t = setTimeout ($_is.load,100);
    }
    
   $_is.load();
    
    //$_is.initialize();  
}


